<template>
	<view>
		<view class="list bg" v-for="(item,index) in list" :key="index" @click="godetails(item.id)">
			<view class="content">
				<view class="head">
					<image :src="item.avatar" mode=""></image>
				</view>
				<view class="head-right">
					<view class="title">
						{{item.nickname}}
					</view>
					<view class="icon">
						<view class="">
							{{item.categoryName}}
						</view>
						<view class="">
							{{item.secondCategory}}
						</view>
					</view>
					<view class="mu">
						<view class="image">
							<image src="/static/mu.png" mode=""></image>
						</view>
						<view class="text">
							{{item.showNum}}
						</view>
					</view>
				</view>
			</view>
			<view class="info">
				<view style="width: 80%;">
					<view class="info-content">
						<view class="btn-box">
							<view class="btn1">
								TOP
							</view>
							<view class="btn2">
								<image src="../static/information/box.png" mode=""></image>
							</view>
						</view>
						<view class="">
							<view class="title">
								{{item.title}}
							</view>
							<view class="sj">
								{{item.time}}
							</view>
						</view>
					</view>
					<view class="box">
						<view class="address">
							<view class="icon">
								<image src="/static/address.png" mode="widthFix"></image>
							</view>
							<view class="text">
								{{item.address|| 'none'}}
							</view>
						</view>
						<view class="distance">
							<view class="icon">
								<image src="/static/distance.png" mode="widthFix"></image>
							</view>
							<view class="text">
								{{item.distance|| 'none'}}
							</view>
						</view>
					</view>
				</view>

				<view class="image">
					<image :src="item.images[0]" mode=""></image>
					<view class="Mask">
						<image src="../static/video.png" mode=""></image>
					</view>
				</view>
			</view>
		</view>
		<view v-show="list.length > 0" style="padding-bottom: 20rpx;">
			<u-loadmore :status="status" :nomore-text="nomoreText" fontSize="12" color="#999" />
		</view>
	</view>
</template>

<script>
	export default {
		name: "postlist",
		data() {
			return {
				status: 'nomore',
				nomoreText: 'The End',
			};
		},
		props: {
			list: {
				type: Array,
				default () {
					return []
				}
			},
		},
		created() {
			console.log(this.list)
			if (this._i18n.locale == 'zh') {
				this.nomoreText = '没有更多了'
				this.cancelText = '取消'
			} else {
				this.nomoreText = 'The End'
				this.cancelText = 'Cancel'
			}
		},
		methods: {
			godetails(id) {
				uni.navigateTo({
					url: '/pages/information/details/index?id=' + id
				})
			},
		}
	}
</script>

<style lang="less">
	.list {
		background-color: #ffffff;
		padding: 20rpx;
		margin: 20rpx;
		border-radius: 20rpx;
		box-shadow: #46b7f9;
		box-shadow: 0px 0px 10px #ececec;
		.info {
			display: flex;
			justify-content: space-between;
			margin-top: 10rpx;

			.box {
				width: 100%;
				display: flex;
				justify-content: space-between;
				margin-left: 10rpx;

				.address {
					width: 50%;
					display: flex;
					align-items: center;

					.icon {
						width: 18rpx;

						image {
							width: 18rpx;

						}
					}

					.text {
						width: 80%;
						font-size: 24rpx;
						color: #999;
						overflow: hidden;
						white-space: nowrap;
						text-overflow: ellipsis;
						-o-text-overflow: ellipsis;
						margin-left: 10rpx;
					}
				}

				.distance {
					width: 50%;
					display: flex;
					align-items: center;

					.icon {
						width: 18rpx;

						image {
							width: 18rpx;
						}
					}

					.text {
						width: 80%;
						font-size: 24rpx;
						color: #999;
						overflow: hidden;
						white-space: nowrap;
						text-overflow: ellipsis;
						-o-text-overflow: ellipsis;
						margin-left: 5rpx;
					}
				}
			}

			.info-content {
				width: 100%;
				display: flex;
				height: 100rpx;

				.title {
					margin-left: 10rpx;
					margin-right: 10rpx;
					font-size: 24rpx;
					color: #333;
					overflow: hidden;
					text-overflow: ellipsis;
					display: -webkit-box;
					-webkit-line-clamp: 2;
					-webkit-box-orient: vertical;
				}

				.sj {
					font-size: 24rpx;
					margin-left: 10rpx;
					color: #999;
				}

				.btn-box {
					height: 100rpx;

					.btn1 {
						background-color: #ff828a;
						padding: 5rpx 18rpx;
						border-radius: 100rpx;
						font-size: 24rpx;
						color: #ffffff;
					}

					.btn2 {
						background-color: #46b7f9;
						padding: 5rpx 18rpx;
						border-radius: 100rpx;
						font-size: 24rpx;
						color: #ffffff;
						margin-top: 5rpx;
						text-align: center;

						image {
							width: 24rpx;
							height: 24rpx;
						}
					}
				}
			}

			.image {
				width: 140rpx;
				height: 140rpx;
				border-radius: 10rpx;
				position: relative;

				.Mask {
					position: absolute;
					width: 100%;
					height: 140rpx;
					border-radius: 10rpx;
					background-color: rgba(0, 0, 0, 0.3);
					top: 0;
					text-align: center;
					line-height: 140rpx;

					image {
						width: 30rpx;
						height: 30rpx;
					}
				}

				image {
					width: 140rpx;
					height: 140rpx;
					border-radius: 10rpx;
				}
			}

		}

		.content {
			display: flex;

			.head-right {
				width: 100%;
				margin-left: 10rpx;
				position: relative;

				.mu {
					position: absolute;
					right: 0rpx;
					top: 0;
					display: flex;
					align-items: center;

					.image {
						image {
							width: 25rpx;
							height: 22rpx;
						}
					}

					.text {
						margin-left: 5rpx;
						font-size: 24rpx;
						color: #999;
					}
				}

				.title {
					font-size: 26rpx;
					font-weight: 600;
				}

				.icon {
					display: flex;
					font-size: 24rpx;
					margin-top: 10rpx;
					color: #599cff;

					view {
						background-color: #f4f4f4;
						margin-right: 10rpx;
						padding: 5rpx 15rpx;
						border-radius: 100rpx;
					}
				}
			}

			.head {
				image {
					width: 80rpx;
					height: 80rpx;
					border-radius: 100rpx;
				}
			}
		}

	}
</style>
